 def compare(i):
 import random
 secret = random.randint(1,10)
 temp = input("guess the number in my heart(from 1 to 10):\n")
 guess = int(temp)
 if guess == secret:
     print("amazing,you are right")
 else:
     if guess > secret:
        print("worring,it's bigger,you have the last two chances")
     else:
        print('OMG! so foolish you are.litter!!The last two chances ~~')
     while i < 2:
           temp = input("guess again please~~:\n")
           guess = int(temp)
           i=i+1
           if guess == secret:
              print("ok,you win.")
              break
           elif (guess > secret):
              if i==1:
                  print("guess it by your heart please!!bigger!last chance")
              else:
                  print("see you latter!biggerererer!")
           elif (guess < secret):
              if i==1:
                 print('want to fuck someone!wrong ,again,litter!last chance')
              else:
                 print('you make me angery,say goodbye to games.')
 print( 'game over')
 return
compare(0)
n=0
while n<10:
  restart = input('do you want to restart?please write 1 or 0:')
  n=n+1
  if restart==1:
    compare(0)
  else:
    print('see you latter')
    break
    

